#ifndef VIDEOWINDOW_H
#define VIDEOWINDOW_H

#include <QMainWindow>
#include <QMediaPlayer>
#include <QMediaPlaylist>

namespace Ui {
class VideoWindow;
}

class VideoWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit VideoWindow(QWidget *parent = nullptr);
    ~VideoWindow();

private slots:
    //自定义槽函数
    void onStateChanged(QMediaPlayer::State state);
    void onPlaylistChanged(int position);  //播放列表改变槽函数
    void onDurationChanged(qint64 duration);
    void onPositionChanged(qint64 position);


    void on_button_back_clicked();  //返回主页面按钮槽函数

    void on_button_add_clicked();

    void on_button_delete_clicked();

    void on_button_previous_clicked();

    void on_button_playState_clicked();

    void on_button_next_clicked();

    void on_button_screen_clicked();

    void on_listWidget_doubleClicked(const QModelIndex &index);

private:
    Ui::VideoWindow *ui;

    QMediaPlayer *player;  //视频播放器
    QMediaPlaylist *playlist;  //播放列表
    QString durationTime;
    QString positionTime;
};

#endif // VIDEOWINDOW_H
